<?php
/**
 * Entry point for the application.
 *
 * @author zonk
 */

require_once '../includes/inc.php';

/**
 * Magic function to load models and views which have not yet been included
 * @param string $name
 * @return void
 */
function __autoload($name){
        if(substr($name, -5) == 'Model'){
                require_once '../model/'.$name.'.class.php';
        }
        else if(substr($name, -4) == 'View'){
                require_once '../view/'.$name.'.class.php';
        }
        else if(substr($name, -10) == 'Controller'){
                require_once '../controller/'.$name.'.class.php';
        }
        else if(substr($name, -8) == 'Template'){
                require_once '../templates/'.$name.'.php';
        }
}

$request = array_merge($_GET, $_POST);
$controller = new MainController($request);
echo $controller->display();
?>